Release 10.1A: OpenEdge Reporting:
Query/Results Administration and Development
API basics
The Results API consists of a set of shared variables and a procedural interface. The following sections provide basic information about how to access the shared variables and procedures of the Results API in a feature or integration procedure.
Accessing shared variables
Results establishes and maintains a set of shared variables, called API shared variables, that you can access and set from a feature or integration procedure. API shared variables provide information about the current state of the Results application and the current query in Results. Table 3–4 provides summary information about the API shared variables available in Results.
To access these API shared variables in a feature or integration procedure, you must define them in your procedure. Typically, you use the
Defined Shared Variablestatement to define a previously established shared variable for use in a procedure. However, Results provides theu-pvars.iinclude file to define the API shared variables for you.Use the following syntax to reference the
u-pvars.iinclude file in the feature or integration procedure:
Once you reference this include file at the top of your procedure, you can access any of the API shared variables. For more information about referencing include files see the OpenEdge Development: Progress 4GL Reference . See the "Accessing and editing the current query" section for more information on how to use the API shared variables in a feature or integration procedure.
Using the procedural interface
Results provides an interface that allows you to manipulate Results queries and execute Results features from a feature or integration procedure. The procedure interface consists of six API procedures. All of the API procedures are located in the procedure library in the
$DLC/guidirectory. Table 3–5 provides summary information about the API procedures available for Results.
To use these API procedures in a feature procedure:
For more information, see the
RUNstatement andDEFINE VARIABLEstatement in the OpenEdge Development: Progress 4GL Reference .The following sections of this chapter describe how to use the different API procedures in a feature procedure.Executing a feature from a feature procedure
The API
sffire.pprocedure executes a feature from a feature procedure. With this capability, you can use features in Results as building blocks for other features. Use the following syntax to call the APIsffire.pprocedure from a feature procedure:
Parameters for the sffire.p procedure
The following list describes the parameters associated with the API
sffire.pprocedure:INPUTfeatureIdA string value representing the name of a feature as defined in Results. For information about Results features, see Appendix A "Results Features."
INPUTargsA string value representing one or more arguments passed to the specified feature. Specify multiple arguments as a comma-separated list. If the feature specified does not take arguments, pass the unknown value (
?) for this parameter. For information about arguments for Results features, see Appendix A "Results Features."OUTPUTresultA logical value that indicates whether the API procedure executed successfully.
If you use the
sffire.pAPI procedure in a feature procedure, you must define a variable for the result output parameter, as shown in Example 3–3.
In Example 3–3, FileOpen is a feature that does not take an argument list. If Results can execute the FileOpen feature, the
OUTPUTparameter result returns aTRUEvalue.Table 3–6 lists several Results features that you can use with the API
sffire.pprocedure. These features are important for developing other feature and integration procedures.
For information about additional features in Results, see Appendix A "Results Features."
Testing the Results version number
The API shared variable
qbf–verscontains a string value representing the Results product version number. The product version number consists of two digits separated by a decimal point, and followed by a letter (for example, 10.0A). Check the version number to verify that the environment you used to develop your feature and integration procedures matches the version of Results at the end-user site.If the versions do not match, API changes between Results versions could cause erratic behavior. Feature and integration procedures that access API shared variables and procedures might yield error messages. Table 3–7 lists some of the error messages that can result from a change to the Results API between versions.
These errors can prevent the feature or integration procedure from executing. To avoid this problem, rebuild your application. See Chapter 2, "Administering Results," for more information about rebuilding an application.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |